<?php
ob_start();

session_start();
if (isset($_SESSION['id'])) {
    unset($_SESSION['id']);
    session_destroy();
}

if (isset($_COOKIE['login']) or isset($_COOKIE['pass'])) {
    unset($_COOKIE['login']);
    unset($_COOKIE['pass']);
    setcookie("login", "", time() - 3600);
    setcookie("pass", "", time() - 3600);
}

redirect("?action=msg&header=header.logout.success&body=body.logout.success&view=index");

ob_flush();